package cn.com.backstage.controller.base;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Date;
import java.text.SimpleDateFormat;

import org.springframework.beans.factory.annotation.Autowired;

import cn.com.api.entity.*;

import cn.com.api.service.*;

import cn.com.util.*;
import cn.com.util.*;


public class BaseController {

	@Autowired
	private ApiT_user_adminService apiT_user_adminService;
	@Autowired
	private StartOnLoadService startOnLoadService;

	/**
	 * 根据后台管理员只显示分站县市
	 * */
    private List<ApiT_city> User_manage_citys(String user_id){
    	ApiT_user_admin user = apiT_user_adminService.findT_user_adminById(Integer.valueOf(user_id));
    	
    	
    	List<ApiT_city> cur_citys = new ArrayList<ApiT_city>();
    	List<ApiT_city> citys = startOnLoadService.citys();
    	// 判断是否超级管理员
    	if(user.getIs_super()==0){
    		// 查询当前管理员分管分站
	    	for(ApiT_city city : citys){
/*	    		if(city.getId()== user.getCity_id()){
	    			cur_citys.add(city);
	    			break;
	    		}*/
	    	}
    	}else{
    		cur_citys.addAll(citys);
    	}
    	//
    	return cur_citys;
    }
	
}



